package com.jurassic.demo.design;

import com.jurassic.demo.entity.User;

/**
 * @Author pan_jin
 * @Description: $
 * @Date: 2022/7/20 9:52
 * @Version: 1.0.0
 * @Slogan: 梦想还是要有的万一实现了呢
 */
public class UserBuilder implements Builder<User> {
    private User user;

    @Override
    public User buildName(String name) {
        this.user.setName(name);
        return this.user;
    }

    @Override
    public User buildPassword(String password) {
        this.user.setPassword(password);
        return this.user;
    }

    @Override
    public User buildEmail(String email) {
        this.user.setEmail(email);
        return this.user;
    }

    public UserBuilder() {
        this.user = new User();
    }
}
